<template>
    <div class="item">
      <div class="cover">
          <div class="playcount">
            {{handlenum(item.playCount)}}
          </div>
          <img class="cover-img" :src="item.coverImgUrl" alt="">
      </div>
        <p class="name">{{item.name}}</p>
    </div>
</template>

<script>
export default {
  props: {
    item:{
      type:Object
    }
  },
  methods:{
    handlenum(value){
      if(value>100000000){
        value = Math.floor(value/100000000)+"亿"
      }else if(value>10000){
        value = Math.floor(value/10000)+"万"
      }
      return value
    }
  }
}
</script>

<style scoped>

  .item{
    width:230px;
    font-size: 30px;
    position: relative;
  }

  .cover-img{
    width:230px;
    height: 230px;
  }
  .playcount{
    position: absolute;
    right:0;
    top:5px;
    color:#fff;
  }
  .name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    overflow: hidden;
    -webkit-line-clamp: 2;
  }
</style>